<template>
  <el-select v-model="model" class="w-full">
    <el-option
      v-for="(option, index) in props.options"
      :key="index"
      :label="option[props.labelField]"
      :value="option[props.valueField]"
    />
  </el-select>
</template>
<script lang="ts" setup>
import type { Select } from "./types";
type ModelValueUnion = string | number | boolean | Recordable | any[];
const model = defineModel<ModelValueUnion>({ required: true });

const props = withDefaults(defineProps<Select>(), {
  labelField: "label",
  valueField: "value",
});
</script>
